# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gst-plugins-ugly
pkgver=1.20.3
pkgrel=1
pkgdesc="GStreamer streaming media framework ugly plug-ins"
url="https://gstreamer.freedesktop.org"
arch="all"
license="GPL-2.0-or-later LGPL-2.0-or-later"
replaces="gst-plugins-ugly1"
makedepends="a52dec-dev glib-dev gst-plugins-base-dev gstreamer-dev libcdio-dev
	libdvdread-dev libmpeg2-dev meson orc-dev x264-dev opencore-amr-dev"
source="https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-$pkgver.tar.xz"
subpackages="$pkgname-lang"
ldpath="/usr/lib/gstreamer-1.0"

# secfixes:
#   1.10.4-r0:
#     - CVE-2017-5846
#     - CVE-2017-5847

build() {
	abuild-meson \
		-Dpackage-origin="https://alpinelinux.org" \
		-Dpackage-name="GStreamer ugly plug-ins (Alpine Linux)" \
		-Damrnb=enabled \
		-Damrwbdec=enabled \
		-Dgpl=enabled \
		-Dcdio=disabled \
		-Ddvdread=disabled \
		-Dmpeg2dec=disabled \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

check() {
	meson test -C output --print-errorlogs
}

doc() {
	default_doc
	replaces="${pkgname}1-doc"
}

sha512sums="
6a18bcd8d90060d14f07dc9f3ac014f7a06a7da13568ddcf871916f3d47878ab73929b71a9863bc7ec08b3ff9418404703c9423100ee844fafd1026ea0be0fb8  gst-plugins-ugly-1.20.3.tar.xz
"
